﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

using HtmlExtractor.Processor;
using System.Xml.Linq;

namespace HtmlExtractor.Config
{
    public class Group : Simple
    {
        
        private GroupInfoCollection groupInfos = new GroupInfoCollection();
        public GroupInfoCollection GroupInfos
        {
            get { return groupInfos; }
        }
        public Group()
        { }
        
        public Group(XElement groupNode)
        {
            if (groupNode != null)
            {
                InitSimple(groupNode);
                foreach (XElement groupInfoNode in groupNode.Elements("GroupInfo"))
                {
                    GroupInfos.Add(new GroupInfo(groupInfoNode));
                }  
            }
           
        }
      
        #region IRule 成员

        public override PageResult GetParseResult(string text,ParserContext context)
        {
            return GetParsResult(text, GroupInfos,context);
           
        }

        #endregion
    }
   
}
